<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="page_right" style="position:relative;">
    <div style="${view==1?"display:''":"display:none"}">
        <p style="width:890px;padding:0 30px;line-height:50px;background:#fff;border-bottom:1px solid #eee;">
            <span>${placeDto.address}</span>
            <a class="place_changename" href="javascript:;">编辑</a>
        </p>
        <div class="place_changedv">
            <input type="text" id="placeName" value="${placeDto.address}" placeholder="请输入场地名称">
            <a class="place_changenamebtn1" href="javascript:;">确认</a>
            <a class="place_changenamebtn2" href="javascript:;">取消</a>
        </div>
    </div>

    <ul class="place_list">
        <li>
            <a href="javascript:;">兑币机<span class="equipment_statenumb">数量：${currencyList.size()==null?0:currencyList.size()}台</span></a>
            <div class="place_listdv">
                <c:forEach items="${currencyList}" var="data">
                    <p><span>${data.deviceName}&nbsp;&nbsp;${data.deviceShortCode}</span><a href="${basePath}v2/device/${data.placeId}/showView/${data.stateName}/${data.deviceId}/deviceView">编辑</a></p>
                </c:forEach>
            </div>
        </li>
        <li>
            <a href="javascript:;">娃娃机<span class="equipment_statenumb">数量：${dollList.size()==null?0:dollList.size()}台</span></a>
            <div class="place_listdv">
                <c:forEach items="${dollList}" var="data">
                    <p><span>${data.deviceName}&nbsp;&nbsp;${data.deviceShortCode}</span><a href="${basePath}v2/device/${data.placeId}/showView/${data.stateName}/${data.deviceId}/deviceView">编辑</a></p>
                </c:forEach>
            </div>
        </li>
        <li>
            <a href="javascript:;">礼品机<span class="equipment_statenumb">数量：${giftList.size()==null?0:giftList.size()}台</span></a>
            <div class="place_listdv">
                <c:forEach items="${giftList}" var="data">
                    <p><span>${data.deviceName}&nbsp;&nbsp;${data.deviceShortCode}</span><a href="${basePath}v2/device/${data.placeId}/showView/${data.stateName}/${data.deviceId}/deviceView">编辑</a></p>
                </c:forEach>
            </div>
        </li>
    </ul>
</div>
<script type="application/javascript">
    function changePlaceName(){
        var place = '${placeId}';
        $.ajax({
            url:'${basePath}v2/place/'+place+'/editPlaceName',
            type : 'POST',
            data : {'placeId':place,"placeName":$("#placeName").val()},
            success: function (ret) {
                if(ret.result) {
                    window.location.href = "${basePath}v2/place/"+place+"/placeView";
                }else{
                    alert(ret.info);
                }
            }
        });
    }
</script>
